<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            /* height: 300px; */
            border: 1px solid #000;
            text-align: center;
            line-height: 300px;
        }
    </style>
</head>
<body>
    <div class="box">
        单行文本水平垂直居中
    </div>
</body>
</html>